const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({note: '<string>'})
};
fetch('https://blackbox.dasha.ai/api/v1/chats/{id}/end', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://blackbox.dasha.ai/api/v1/chats/{id}/end \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"note": "<string>"
}
'import requests
url = "https://blackbox.dasha.ai/api/v1/chats/{id}/end"
payload = { "note": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "<string>",
"channel": "<string>",
"messages": [
{
"role": "<string>",
"content": "<string>",
"tool_calls": [
{
"id": "<string>",
"name": "<string>",
"arguments": "<unknown>",
"response": "<unknown>"
}
],
"time": "2023-11-07T05:31:56Z"
}
],
"created_time": "2023-11-07T05:31:56Z",
"last_activity": "2023-11-07T05:31:56Z",
"ttl_seconds": 123,
"is_final": true,
"status": "<string>",
"final_reason": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}End a chat session under the `user_end` reason.
Runs the same lifecycle pipeline a voice call’s completion does: post-call analysis, completion webhook, Postgres CallResult, Elasticsearch index, audit event. Idempotent — calling on an already-final session returns the current snapshot without re-running the pipeline.
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({note: '<string>'})
};
fetch('https://blackbox.dasha.ai/api/v1/chats/{id}/end', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://blackbox.dasha.ai/api/v1/chats/{id}/end \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"note": "<string>"
}
'import requests
url = "https://blackbox.dasha.ai/api/v1/chats/{id}/end"
payload = { "note": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "<string>",
"channel": "<string>",
"messages": [
{
"role": "<string>",
"content": "<string>",
"tool_calls": [
{
"id": "<string>",
"name": "<string>",
"arguments": "<unknown>",
"response": "<unknown>"
}
],
"time": "2023-11-07T05:31:56Z"
}
],
"created_time": "2023-11-07T05:31:56Z",
"last_activity": "2023-11-07T05:31:56Z",
"ttl_seconds": 123,
"is_final": true,
"status": "<string>",
"final_reason": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Path Parameters
Body
Request body for POST /api/v1/chats/{id}/end. Always finalises the session under
the user_end reason (the TTL sweeper uses ttl, the agent uses
agent_finish) and runs the same !:TextChatCallLifecycle.FinishAsync
pipeline a voice call uses — completion webhook + post-call analysis + persistence.
Optional operator-supplied free-form note appended to the activity log for this finalisation. Not used by the pipeline; purely audit metadata.
Response
Session ended (or was already final).
Public projection of a chat session — what callers see via GET /api/v1/chats/{id}
and the list endpoint. Deliberately omits the orchestration State blob, the
ExternalIdHash, and the worker hot-flags; those are server-internal.
Session identifier.
Agent driving this session. Frozen at open.
Channel name (web, twilio_sms, …).
Full conversation transcript so far, in send order.
Show child attributes
Show child attributes
Session creation timestamp (UTC).
Most recent activity timestamp (inbound, outbound or assistant turn).
Inactivity timeout in seconds; null when no TTL applies.
True once the session has terminated.
Status mirror of DashaAI.BlackBox.AgentAPI.TextChat.Dtos.Chats.ChatSessionDto.IsFinal for list-endpoint filtering (active /
final).
Reason for finalisation (ttl, user_end, agent_finish, …).
Was this page helpful?